import Vue from 'vue'
import Router from 'vue-router'
import login from '@/components/login/index' //登录

import home from '@/components/content/index' //首页
import register from '@/components/register/index' //登记
import registerIndex from '@/components/register/tools/index' //登记
import history from '@/components/register/tools/viewEdit'
import bespoke from '@/components/bespoke/index' //预约
import bespokeIndex from '@/components/bespoke/tools/index' //预约
import bespokeEdit from '@/components/bespoke/tools/edit' //预约
import caseBook from '@/components/caseBook/index' //病例
import caseBookList from '@/components/caseBook/tools/index' //病例
import caseBookEdit from '@/components/caseBook/edit/index' //病例
import caseReview from '@/components/caseBook/detail/review' //病例
import caseRevise from '@/components/caseBook/detail/revise' //病例
import caseView from '@/components/caseBook/detail/view' //病例
import follow from '@/components/followUp/index' //随访
import followIndex from '@/components/followUp/tools/index' //随访
import followEdit from '@/components/followUp/tools/edit' //随访
import followNext from '@/components/followUp/tools/next' //随访
import template from '@/components/template/index' //模板
import templateIndex from '@/components/template/tools/index' //模板
import templateEdit from '@/components/template/tools/edit' //模板
import templateInspect from '@/components/template/tools/inspect' //模板
import system from '@/components/system/index' //设置
import systemIndex from '@/components/system/tools/index' //设置
import addAccount from '@/components/system/edit/account' //设置
import addUser from '@/components/system/edit/user' //设置
import addOffice from '@/components/system/edit/office' //设置
import password from '@/components/system/edit/password' //设置

Vue.use(Router)

export default new Router({
  routes: [{
    path: '/',
    name: 'login',
    component: login
  }, {
    path: '/home',
    name: 'home',
    component: home,
    redirect: '/home/register',
    children: [{
      path: '/home/register',
      name: 'register',
      component: register,
      redirect: '/home/register/index',
      children: [{
        path: '/home/register/index',
        name: 'registerIndex',
        component: registerIndex,
        meta: {
          name: ['登记']
        },
      }, {
        path: '/home/register/history',
        name: 'history',
        component: history,
        meta: {
          name: ['登记历史', '123']
        },
      }]
    }, {
      path: '/home/bespoke',
      name: 'bespoke',
      component: bespoke,
      redirect: '/home/bespoke/index',
      children: [{
        path: '/home/bespoke/index',
        name: 'bespokeIndex',
        component: bespokeIndex,
        meta: {
          name: ['预约']
        }
      }, {
        path: '/home/bespoke/edit',
        name: 'bespokeEdit',
        component: bespokeEdit,
        meta: {
          name: ['预约', '新增预约']
        }
      }]
    }, {
      path: '/home/caseBook',
      name: 'caseBook',
      redirect: '/home/caseBook/index',
      component: caseBook,
      children: [{
        path: '/home/caseBook/index',
        name: 'caseBookList',
        component: caseBookList,
        meta: {
          name: ['病例']
        }
      }, {
        path: '/home/caseBook/edit',
        name: 'caseBookEdit',
        component: caseBookEdit,
        meta: {
          name: ['病例', '信息编辑']
        }
      }, {
        path: '/home/caseBook/review',
        name: 'caseReview',
        component: caseReview,
        meta: {
          name: ['病例', '胡忠信', '诊疗信息', 'TMS(经颅磁刺激)', '查看/编辑']
        }
      }, {
        path: '/home/caseBook/view',
        name: 'caseView',
        component: caseView,
        meta: {
          name: ['病例', '胡忠信', '诊疗信息', 'TMS', '查看/编辑']
        }
      }, {
        path: '/home/caseBook/revise',
        name: 'caseRevise',
        component: caseRevise,
        meta: {
          name: ['病例', '胡忠信', '诊疗信息', 'TMS', '修改套餐']
        }
      }]
    }, {
      path: '/home/follow',
      name: 'follow',
      redirect: '/home/follow/index',
      component: follow,
      children: [{
        path: '/home/follow/index',
        name: 'followIndex',
        component: followIndex,
        meta: {
          name: ['随访']
        }
      }, {
        path: '/home/follow/edit',
        name: 'followEdit',
        component: followEdit,
        meta: {
          name: ['随访', '待随访', '新增随访']
        }
      }, {
        path: '/home/follow/next',
        name: 'followNext',
        component: followNext,
        meta: {
          name: ['随访', '待随访', '随访']
        }
      }]
    }, {
      path: '/home/template',
      name: 'template',
      redirect: '/home/template/index',
      component: template,
      children: [{
        path: '/home/template/index',
        name: 'templateIndex',
        component: templateIndex,
        meta: {
          name: ['模板']
        }
      }, {
        path: '/home/template/edit',
        name: 'templateEdit',
        component: templateEdit,
        meta: {
          name: ['模板', '医嘱模板', '新增医嘱']
        }
      }, {
        path: '/home/template/inspect',
        name: 'templateInspect',
        component: templateInspect,
        meta: {
          name: ['模板', '检查模板', '新增检查套餐']
        }
      }]
    }, {
      path: '/home/system',
      name: 'system',
      redirect: '/home/system/index',
      component: system,
      children: [{
        path: '/home/system/index',
        name: 'systemIndex',
        component: systemIndex,
        meta: {
          name: ['设置']
        }
      }, {
        path: '/home/system/addAcount',
        name: 'addAccount',
        component: addAccount,
        meta: {
          name: ['设置', '账号设置', '新增账号']
        }
      }, {
        path: '/home/system/addUser',
        name: 'addUser',
        component: addUser,
        meta: {
          name: ['设置', '账号设置', '新增角色']
        }
      }, {
        path: '/home/system/addOffice',
        name: 'addOffice',
        component: addOffice,
        meta: {
          name: ['设置', '账号设置', '新增科室']
        }
      }, {
        path: '/home/system/password',
        name: 'password',
        component: password,
        meta: {
          name: ['个人中心', '修改密码']
        }
      }]
    }]
  }]
})
